masterofmagicfandomcom-20200216-history
User talk:SeravySensei
Welcome Hi, welcome to ! Thanks for your edit to the Life Steal page. Please note that at the moment we are asking all our new editors to avoid creating any new pages. This is being asked to avoid having partially written pages that can be forgotten because they are no longer on our needed list. If you have information that you think is missing from the wiki, please post that in our Forum:Suggestions or in the Talk section of already written pages. Please take time to check out the Community Messages (found on the Recent Wiki Activity) where you will find more recommendations. Do feel free to edit any of the existing pages - there are many that need work. If you're looking for stuff to do here, you can contact me by leaving a message on my talk page. Have fun! -- Spearman D92-R (talk) 18:08, November 9, 2015 (UTC) :Thanks so much for your articles on the ai!! --Spearman D92-R (talk) 15:23, February 14, 2016 (UTC) Mods-Page: MoM 1.50 and CoM are missing Hi, on the Mods-Page (http://masterofmagic.wikia.com/wiki/Mod ) your modifications MoM 1.50 and CoM are missing. It would be nice if you can write some words about them (with downloadlinks perhaps). Thanks from a fan! Vicwaberub (talk) 15:28, January 17, 2016 (UTC) Category Diplomacy I put a lot of your new arcitles in a new category "Diplomacy". I hope I have found them all. You can check this at http://masterofmagic.wikia.com/wiki/Category:Diplomacy Thank you for your articles! Vicwaberub (talk) 17:12, January 29, 2016 (UTC) MediaWiki Hello. You seem to be older and also active wiki contributor. Dont you know who should i contact when i want to add javascript to wiki? I dont have rights to edit MediaWiki namespace. --Wolfeek91 (talk) 08:01, June 27, 2016 (UTC) Music in MoM I just came across the "How's MoM do the music" thread on RB, but I don't really feel like regging there, so I figured I'll dump this on you here (doing a little sidetrack from what I was doing otherwise) =) MoM uses the Miles / IBM Audio Interface Library, the full source code of which is now in the public domain and can be downloaded through John Miles' homepage (http://www.ke5fx.com/). You have to scroll down to the bottom and find "AIL Version 2", which is the library used by MoM. If you look in IDA, seg037 of WIZARDS.EXE is the entirety of ail.asm from disk3 of the distribution. The documentation that comes with the library, and the extra resources available on the net should let you create your own tracks fairly easily. seg038 are the sound-related routines, parts of which were taken directly from the example programs that come with AIL (source code also included). In terms of how the XMIDI files interact with the LBX files, the entries are loaded directly into a sound memory buffer allocated at startup (segment address is stored at dseg:9390). Once loaded, the game skips the first paragraph (16 bytes), which are used as the identifier, both to mark the data as sound data (magic word "DEAF"), followed by the type (XMIDI/VOC), and some zero bytes to fill the paragraph. Everything after that is sent directly to the AIL for playback, as is. For a MIDI sequence, we call _AIL_register_sequence, possibly do some global timbre loading (for General MIDI and Roland), and then call _AIL_start_sequence. All of this is in SND_PlayFile() (WIZARDS.EXE @ $2467B), for which the single argument is the segment address for the loaded LBX entry, as returned by LBXE_LoadReplace() (WIZARDS.EXE @ $8266, sorry about by naming conventions =P). For reference, here are the contents of the SOUNDDRV.LBX file, which are the "LBXified" AIL drivers, one per entry, MIDI-Digital: sounddrv.lbx: speaker - adlib - MVT/SB - SBPro1 - SBPro2 - MVPAS 8 - MVPAS 16 - AdLibGold - Roland - Roland 0 - Copyright © 1991,1992 Miles Design, Inc.; IBM PC or compatible internal speaker 1 - DIGPAK; IBM Internal Speaker background; The Audio Solution, Copyright © 1991; Written by John W. Ratcliff 2 - Copyright © 1991,1992 Miles Design, Inc.; Ad Lib® Music Synthesizer Card 3 - DIGPAK; Adlib or compatible; The Audio Solution, Copyright © 1991; Written by John W. Ratcliff 4 - Copyright © 1991,1992 Miles Design, Inc.; Creative Labs Sound Blaster™ FM Sound; Media Vision Thunderboard™ FM Sound 5 - Copyright © 1991,1992 Miles Design, Inc.; Creative Labs Sound Blaster™ Digital Sound; Media Vision Thunderboard™ Digital Sound 6 - Copyright © 1991,1992 Miles Design, Inc.; Creative Labs Sound Blaster Pro™ FM Sound 7 - Copyright © 1991,1992 Miles Design, Inc.; Creative Labs Sound Blaster Pro™ Digital Sound 8 - Copyright © 1991,1992 Miles Design, Inc.; Creative Labs Sound Blaster Pro™ FM Sound 9 - Copyright © 1991,1992 Miles Design, Inc.; Creative Labs Sound Blaster Pro™ Digital Sound 10 - Copyright © 1991,1992 Miles Design, Inc.; Media Vision Pro Audio Spectrum™ 8 FM Sound 11 - Copyright © 1991,1992 Miles Design, Inc.; Media Vision Pro Audio Spectrum™ Digital Sound 12 - Copyright © 1991,1992 Miles Design, Inc.; Media Vision Pro Audio Spectrum™ Plus/16 FM Sound 13 - Copyright © 1991,1992 Miles Design, Inc.; Media Vision Pro Audio Spectrum™ Digital Sound 14 - Copyright © 1991,1992 Miles Design, Inc.; Ad Lib® Gold Music Synthesizer Card 15 - Copyright © 1991,1992 Miles Design, Inc.; Ad Lib® Gold Music Synthesizer Card 16 - Copyright © 1991,1992 Miles Design, Inc.; Roland MT-32 or compatible with Roland MPU MIDI Interface; Roland LAPC-1 17 - DIGPAK; IBM Internal Speaker background; The Audio Solution, Copyright © 1991; Written by John W. Ratcliff 18 - Copyright © 1991,1992 Miles Design, Inc.; Roland MT-32 or compatible with Roland MPU MIDI Interface; Roland LAPC-1 19 - DIGPAK; IBM Internal Speaker background; The Audio Solution, Copyright © 1991; Written by John W. Ratcliff 20 - Roland init music/timbrebank 21 - General MIDI init music/timbrebank And here are the CONFIG.MOM values used to select from these by _main() (WIZARDS.EXE @ $68C7): CONFIG.MOM offsets: 00h midi io 02h midi hardware ($20 for sb, $38 for gen MIDI) 04h midi irq? 06h digi io 08h digi hardware 0Ah digi irq 0Ch digi drq Hardware identifiers: 00 - no sound 0 MIO -1, MIRQ -1 0 IO -1, IRQ -1, DMA -1 01 - ? (speaker?) 1 MIO -1, MIRQ -1 1 IO -1, IRQ -1, DMA -1 10 - AdLib (music only) 2->2 MIO -1, MIRQ -1 2 IO -1, IRQ -1, DMA -1 12 - Not Applicable, Sound Blaster (orig.) 3 MIRQ -1 3 18 - Sound Blaster Pro (early) 4 MIRQ -1 4 20 - Sound Blaster Pro (later, OPL3) 5 MIRQ -1 5 MIRQ = IRQ, di = DMA 19 - Pro Audio Spectrum 6 MIO -1, MIRQ -1 6 IO -1 21 - Pro Audio Spectrum Plus/16 7 MIO -1, MIRQ -1 7 IO -1 22 - ? (AdLib Gold) 8 MIO -1, MIRQ -1 8 30 - Roland MT-32 9 9 IO -1, IRQ -1, DMA -1 31 - Roland LAPC/CM-32L 9 9 IO -1, IRQ -1, DMA -1 38 - General MIDI 0A 0A IO -1, IRQ -1, DMA -1 These were taken from my notes as is though, there were still a few things I was unsure about. However, I WAS about to delete this stuff... AIL does have conversion tools to create XMIDI files, and you should be familiar enough with the LBX format to add them to a file I believe? Good luck! Drake178 (talk) 04:05, April 5, 2018 (UTC) COM Remaining Skill Display I was just reading your COM patch notes last night and saw the question about disabling the anti-aliasing bits for the new Remaining Skill display (now visible when opening the overland spellbook), so I decided to take a quick look at the code. Unfortunately, I still didn't get around to rebuilding my database, but I think I managed to find the problem nonetheless, and may be able to help you fix it. If I'm understanding it correctly, you optimized a few instructions in the spellbook display routine to squeeze in a near call at $92293, to a repurposed function of your own making. This is a small block that passes the remaining skill value and two immediate values (which I assume are the display coordinates) to one of the text (integer) drawing routines. If that is correct, then what you're missing is a call to the Font_Color_Setup(Font_Index, DAC_Color_Array_Ptr) function ($C6BD). This is what the game typically calls before drawing text, and it should allow you to both remove the anti-aliasing bits, and change the color of the font used to display the remaining skill (only within the same palette though, I think). There is one catch though. If I remember right, there are two sets of text drawing routines, only one of which treats color #0 as transparent, which is probably what you'll want. Let's hope for now that you used the right one straight away. You also need a far call for this, but I saw 3 streams of nops with one untouched word inbetween, right after your custom function, and assume that these are unused original far calls, that should suit your purpose perfectly. Since Font_Color_Setup() takes an array pointer parameter, I strongly recommend modifying your function to use a bp frame, as you'll need to pass at least 6 bytes (I would go with the full 16 for safety reasons, but I saw this function called with only 6 set elsewhere). You want to set this up so that the first byte in the array (index 0) is zero, and the rest are the font color (I beleive this is a monchrome font). The index of this font is 4, which you'll need to push through ax next. Then make the call before you draw the number (maybe jump ahead and back to only have to modify one far call). You can find a template of how this is originally done in multiple places, for example where I've patched the researched spell (at $94B49). Sadly, I don't exactly know which color the header font originally is, and have failed to track down where it is set. In the Apprentice, it is the $37, $2F, $27, $2E (dup 12) array, using font index 5, which is multi-color by default. From that, I'd guess the one you'd need is $37. But you may want to experiment anyway, just in case you find a better color. Drake178 (talk) 19:32, July 21, 2018 (UTC) Edit: If you don't mind losing the anti-aliasing bits on the page headers/titles, then an easier solution might be to track down the orgininal color setup call for font index 4, and replace the byte assigned to the first element of the array with a zero. Drake178 (talk) 00:44, July 22, 2018 (UTC) 1.51 RCx Bugs and fixes =) :* Maybe next one: Do you feel like fixing the monster cost discrepancy between Encounter Zones and Rampaging Monsters, or leave it as it is? Drake178 (talk) 10:32, January 11, 2018 (UTC) :* Next one, replacing a previous unaccepted one: v1.31: AI no longer spams dispel-type spells on Heroes wearing Haste items v1.40 - v1.51: AI can now target units enchanted with Haste with dispel-type spells No Eldritch Weapon flag, sorry about that. Still CoM-compatible (mostly). Base code, all versions (WIZARDS.EXE): ; AI Dispel priority ignores the Haste Item Power 81A63 87 07 ; Heroes with Haste items are not valid targets for the Haste spell ; ("That unit already has Haste cast on it") 86408 08 88 ; Haste items now apply a different combat effect flag 90228 08 80 ; Haste items apply in the combat sequence 99361 08 88 99502 08 88 ; !!! omit the following one for CoM !!! 9985C 08 88 99971 08 88 ; Haste items double unit movement ; !!! replace with 9F247 for CoM !!! 9F3D0 08 88 For v1.31, add the following (WIZARDS.EXE): ; AI spell picker ignores Haste items when considering Dispel type spells BA162 97 17 BB444 97 17 BB5D4 97 17 For v1.40n, add this instead (WIZARDS.EXE): ; v1.40+ only (undoes a propagated Insecticide change): ; AI Dispel priority no longer ignores Haste 81BC7 60 68 ; v1.31-v1.40 only, REPLACE FOR v1.50 (this code is no longer there) ; AI spell picker ignores Haste items when considering Dispel type spells BA162 97 17 BB444 97 17 BB5D4 97 17 ; v1.40 only (undoes an Insecticide change that did not propagate to v1.50): ; AI spell picker no longer ignores Haste when considering Dispel type spells BA1C0 60 68 BB4A2 60 68 Finally, for v1.51, add the following instead of either of the above two (WIZARDS.EXE): ; v1.40+ only (undoes a propagated Insecticide change): ; AI Dispel priority no longer ignores Haste 81BC7 60 68 ; v1.50 optional: Haste has a Dispel priority (at least as much as the lesser enchants) ; shorten one of the checks by removing redundant instructions to make space 81C76 46 56 81C77 FA F8 81C78 8B 83 81C79 56 E2 81C7A F8 20 81C7B 83 74 81C7C E2 03 81C7D 20 83 81C7E 25 C6 81C7F 00 0A ; implement a Haste Unit Enchantment check 81C80 00 26 81C81 0B F7 81C82 D0 47 81C83 74 22 81C84 03 00 81C85 83 08 81C86 C6 74 81C87 0A 03 ; flowing into the next check, luckily it was another redundant instruction 81C88 8B 83 81C89 46 C6 ; this is the actual priority value byte, change as desired (currently 10 + 4) 81C8A FA 0E ; v1.50 AI spell picker no longer ignores Haste when considering Dispel type spells ; combine logical jumps to remove redundant unit status and owner check BA152 13 77 BA15C 09 13 BA164 01 65 BA16E 26 EB BA16F 80 5A ; replace redundant checks with a Haste UE check, add standard per-enchant value if present BA170 7F 26 BA171 34 F7 BA172 00 47 BA173 75 22 BA174 55 00 BA175 26 08 BA176 8A 74 BA177 47 03 BA178 35 83 BA179 98 C1 ; priority value byte (7) BA17A 3B 07 BA17B 46 90 BA17C 06 90 BA17D 74 90 BA17E 4B 90 ; v1.50 AI spell picker no longer ignores Haste when considering Disenchant type spells ; combine logical jumps to remove redundant unit status and owner check BB512 13 21 BB51C 09 19 BB533 26 90 BB534 80 EB ; replace redundant checks with a Haste UE check, add standard per-enchant value if present BB536 34 26 BB537 00 F7 BB538 75 47 BB539 7B 22 BB53A 26 00 BB53B 8A 08 BB53C 47 74 BB53D 35 03 BB53E 98 83 BB53F 3B C1 ; priority value byte (7) BB540 46 07 BB541 06 90 BB542 74 90 BB543 71 90 For CoM, a new AI spell priority assignment is probably required for the original Haste flag (that function is completely different than the original, you're far better suited to do that than I am), but apart from those last two sections, the rest of the v1.50 code is compatible, up to and including the Dispel targeting function. :* Next one: Related to the above: Non-Attack Item Powers are now displayed in the Unit Statistics Window as intended This affects mostly the Haste Item Power, but also displays the Giant Strength and Merging ones. These are the only three that do not get copied over into the battle unit but are nonetheless included in the table for Item Power icons and help texts (i.e. were originally intended to be displayed). The code below changes the USW to use the item power flags directly rather than from the battle unit (at least for this group of powers, does not affect the attack flags, those are displayed from another table, but you know that already). If you don't want Merging and Giant Strength (the former may already be visible from elsewhere, I didn't check; and the latter has incorrect help text), there's room at the end for a well-placed AND $D7FF... v1.31 - v1.51 (WIZARDS.EXE) ; Non-Attack Item Powers are now displayed in the Unit Statistics Window as intended ; remove a redundant unit index retrieval and replace it with ; variable setup, starting with what the index was retrieved for 5C409 8B 26 5C40A 46 8A 5C40B 06 47 5C40C B1 06 5C40D 05 98 5C40E D3 89 5C40F E0 46 5C410 C4 F8 ; zero out the (already present) enchantment flags local variables 5C411 1E C7 5C412 C2 46 5C413 9E F2 5C414 03 00 5C415 D8 00 5C416 26 C7 5C417 8A 46 5C418 47 F4 5C419 06 00 5C41A 98 00 5C41B 89 90 5C41C 46 90 5C41D F8 90 ; extend the item icon display setup branch for existing items 5C4C2 8E 6A ; remove a redundant item slot type retrieval from the empty item slot code 5C512 D1 53 5C513 E3 D1 5C514 8B E3 5C515 87 8B 5C516 5C 87 5C517 97 5C 5C518 8B 97 5C519 D7 8B 5C51A D1 D7 5C51B E2 D1 5C51C 8B E2 5C51D 5E 8B 5C51E 08 5E 5C51F 03 08 5C520 DA 03 5C521 89 DA 5C522 87 89 5C523 50 87 5C524 05 50 5C525 8B 05 5C526 46 58 5C527 FA 05 5C528 BA 40 5C529 C8 02 5C52A 04 F7 5C52B F7 D8 5C52C EA EB 5C52D 50 24 ; use the space gained to set up the local enchantment bitflags ; (arriving from the existing item code branch) 5C52E 8B 53 5C52F 46 50 5C530 F8 90 5C532 1C 32 5C536 5B C4 5C537 03 1E 5C538 D8 36 5C539 8B 91 5C53A 46 03 5C53B FC D8 5C53C D1 26 5C53D E0 8B 5C53E 03 47 5C53F D8 2E 5C540 8B 09 5C541 87 46 5C542 56 F2 5C543 9F 26 5C544 05 8B 5C545 40 47 5C546 02 30 5C547 F7 09 5C548 D8 46 5C549 8B F4 5C54A D7 58 5C54B D1 5B 5C54C E2 90 5C54D 8B 90 5C54E 5E 90 5C54F 08 90 5C550 03 90 5C551 DA 90 ; use the local enchantment flags when displaying (relevant) item enchantments ; instead of the (incomplete) copy kept in the battle unit record 5C56F 26 90 5C571 47 46 5C572 2E F4 5C573 26 90 5C575 57 56 5C576 2C F2 Drake178 (talk) 01:58, January 30, 2018 (UTC) :* Next one: could be more of a feature than a fix I guess Trying to cast Dispel Evil with no opposing Death or Chaos creatures will now prompt the proper error message v1.31 - v1.51 (WIZARDS.EXE) 84872 03 07 84873 E9 81 84874 82 7E 84875 00 06 84876 33 86 84877 FF 00 84878 33 75 84879 F6 7E 8487A EB 33 8487B 40 FF 8487C 8B 33 8487D C6 F6 8487E BA EB 8487F 6E 3C 84880 00 90 84889 26 8B 8488A 80 C6 8488B 7F BA 8488C 35 6E 8488E 74 F7 8488F 2B EA 84890 8B C4 84891 C6 1E 84892 BA 2A 84893 6E 92 84894 00 03 84895 F7 D8 84896 EA 26 84897 C4 80 84898 1E 7F 84899 2A 35 8489A 92 00 8489B 03 74 8489C D8 1E 848C5 B6 C3 Drake178 (talk) 01:55, February 1, 2018 (UTC) :* Next one: Trying to cast a unit spell that only works on normal units in combat will now display the correct error if all "valid" units are dead v1.31 - v1.51 (WIZARDS.EXE) 84C56 8B 26 84C57 C6 80 84C58 BA 7F 84C59 6E 34 84C5B F7 75 84C5C EA 10 84C5D C4 EB 84C5E 1E 04 84C5F 2A 90 84C60 92 90 84C61 03 90 84C62 D8 90 84CD9 8B 26 84CDA C6 80 84CDB BA 7F 84CDC 6E 34 84CDE F7 75 84CDF EA 10 84CE0 C4 EB 84CE1 1E 04 84CE2 2A 90 84CE3 92 90 84CE4 03 90 84CE5 D8 90 Drake178 (talk) 04:22, February 1, 2018 (UTC) :* Next one: Fixes bug: healers override natural healing for units created after them (healer unit index bug) Naturally does not apply to CoM, as the changes there do not require it any more. v1.31 - v1.51 (WIZARDS.EXE) ; healers set only one bit instead of the whole value BEA35 C6 80 BEA36 07 0F BEA37 42 40 ; remove the healer bit during natural healing BEA50 8B 83 BEA51 C6 66 BEA52 B1 08 BEA53 05 2F ; clear redundant instructions (can jump for 6 less bytes changed) BEA54 D3 90 BEA55 E0 90 BEA56 C4 90 BEA57 1E 90 BEA58 C2 90 BEA59 9E 90 BEA5A 03 90 BEA5B D8 90 ; healers check one bit instead of the whole value BEDEB 80 F6 BEDEC 3F 07 BEDED 42 40 ; jump type change (its test instead of cmp) BEDEE 74 75 :* Next one: Life Stealing units no longer regain figures lost to Irreversible Damage So my question was: can temporary extra hits be gained by a unit that lost a figure to Irreversible Damage? Which led to finding this bug. Because overhealing is allowed for lifestealers, they can enter the figure restoration branch without actually being healed, regaining no hits, removing no damage, just gaining figures out of thin air. Obviously the USW and the damage tracking goes down the drain. This fix disables overhealing if any Irreversible Damage was taken. A better solution may be to allow gaining extra hits with the new maximum figure count, but then every time hits are gained, the Irreversible Damage would need to be adjusted to match the product of the total hits multiplied by the disintegrated figures. The code was not designed to handle this scenario, so I went for the easy fix. I took a quick look at the CoM code, and this one does seem to apply to it, although I did not look that hard, so I may be wrong. All versions (WIZARDS.EXE) ; remove redundant instructions from calculating healable amount ; move the variable setup upwards to their place 7FCD9 8B 26 7FCDA C6 8A 7FCDB BA 47 7FCDC 6E 36 7FCDD 00 5A 7FCDE F7 03 7FCDF EA D0 7FCE0 C4 89 7FCE1 1E 56 7FCE2 2A FC 7FCE3 92 C7 7FCE4 03 46 7FCE5 D8 FE 7FCE6 26 00 7FCE7 8A 00 ; load Irreversible Damage 7FCE8 47 26 7FCE9 36 8A 7FCEA B4 47 7FCEB 00 38 ; check if above 0 7FCEC 5A 83 7FCED 03 F8 7FCEE D0 00 ; jump to overheal limit code if it is 7FCEF 89 7F 7FCF0 56 0C ; nop the remaining redundant bytes (can jump for 4 less changes) 7FCF1 FC 90 7FCF2 C7 90 7FCF3 46 90 7FCF4 FE 90 7FCF5 00 90 7FCF6 00 90 Drake178 (talk) 01:29, November 10, 2018 (UTC) :* Next one: Fixes all(?) of the city screen gold income breakdown bugs Will get one warning with the RC as it overwrites W515FIX.TXT Corrects marketplace and road/river/ocean gold ignoring the dwarven racial; miner's guild reporting more gold than it grants when there are multiple gold veins or gems; merchant's guild ignoring minerals and miners' guild entirely; and some miscellaneous rounding bugs. Also incorporates a replacement for 515 (dwarves + prosperity). Breakdown sum should now always match the actual income total. Removing an asset should also result in a net loss equal to its listed contribution, with the exception of the actual minerals and the miners' guild, as losing these will also affect the percentage sources. This could possibly be done the other way, ie. the income being reported as coming from the mines/guild, but then removing a percentage source would also reduce these. Based on the existing code, that was not the intended behaviour though, and I think it would also be a lot more complicated to implement properly. v1.31 - v1.51 (WIZARDS.EXE) ; give dwarves a few more bytes C34DC 07 0A ; set the boolean into ax instead C34DD C7 B8 C34DE 46 01 C34DF F4 00 ; double the gold (in both places) C34E0 01 D1 C34E1 00 66 C34E2 EB FC C34E3 05 D1 C34E4 C7 24 ; jump out C34E5 46 EB C34E6 F4 02 ; not dwarves C34E7 00 33 C34E8 00 C0 ; set local dwarves variable C34E9 C7 89 C34EB F0 F4 ; zero the loop variable ahead of time C34EC 00 33 C34ED 00 FF ; jump to the miner's guild check C34EE 33 E9 C34EF FF B5 C34F0 EB 00 ; in the loop: add silver ore directly to the return values C351A 46 44 C351B F0 04 ; jump to gold ore check C351C 47 EB C351D 3B 13 ; add gold ore directly to the return values C3559 46 44 C355A F0 06 ; jump to gems check C355B 47 EB C355C 3B 13 ; add gems directly to the return values C3598 46 44 C3599 F0 08 ; jump to what's originally the second series of checks C359A 47 EB C359B 3B 5C ; jump into the loop straight after setting the miners' ; guild local variable, do the counting afterwards C35DC 83 E9 C35DD 7E 98 C35DE F6 00 ; once back here, don't halve the ore incomes C35EE D1 90 C35EF F8 90 ; simply deduct them from the miners' guild total instead, ; which also zeroes it out if there isn't one built C35F0 89 29 ; then jump past the loop instead of into it C35F6 7F 9A ; second series of individual ore checks are originally here, ; but instead of that, call the combined check function once C3618 6B 66 ; and add the result to the miner's guild total C3622 FF 01 C3623 76 44 C3624 F4 0A ; then skip straight to the loop condition C3625 FF EB C3626 76 4F ; shift the loop's starting place to the silver check C367D 79 73 C367E FF FE ; after the loop, calculate the miner's guild C367F 8B E9 C3680 46 60 C3681 06 FF ; before checking river/road/ocean gold, save the base total ; gold to di and halve it now to save space later C3692 75 8B C3693 04 7E C3694 8B FC C3695 04 D1 C3696 01 FF C3697 04 90 ; after setting the return, don't zero the river/road/ocean ; gold local variable, but zero cx instead C375F C7 90 C3760 46 90 C3761 F2 B9 ; if there is a market, increase cx, C378E 33 41 ; set the marketplace gold from di, C378F C0 89 C3790 BA 7C C3791 64 0E ; and jump to the bank check C3792 00 EB C3793 50 1D ; while after the bank check add 2 to cx if built, C3794 52 83 C3795 8B C1 C3796 46 02 ; and set the bank gold from di as well C3797 FC 89 C3798 99 7C C3799 50 10 ; also arrive here if there was no bank, and now set ; di to the full base income instead of just half, C379A 52 8B C379B 33 7E C379C D2 FC ; then check its parity C379D B8 F7 C379E 32 C7 C379F 00 01 C37A0 59 00 ; if its even, nothing needs doing, carry on C37A1 5B 74 C37A2 9A 5B ; if odd, adjustments may be necessary, see below C37A3 FE EB C37A4 05 09 C37AE 89 E9 C37AF 44 96 C37B0 0E 00 ; adjust jumps if bank is built, C37C5 15 CE ; not built, C37DA 23 BF ; or replaced C37DB 33 EB C37DC C0 B7 ; jump back to here to check river/road/ocean remainder C37E8 33 8B C37E9 D2 46 C37EA B8 F2 C37EB 32 99 C37EC 00 90 ; call LMOD instead of LDIV, C37F7 34 43 ; and return back ahead with the result C37FB 89 59 C37FC 44 EB C37FD 10 5D ; set merchant's guild gold from di instead of ax C382B 44 7C ; prosperity is also exactly equal to this... C3842 8B 89 C3843 04 7C C3844 03 14 C3845 44 EB C3846 04 26 ; arriving here if the base income was odd ; check if either market or bank are present C3847 03 83 C3848 44 F9 C3849 06 00 ; if neither, get out of here C384A 03 74 C384B 44 B2 ; if yes, check whether it's both C384C 08 83 C384D 03 F9 C384E 44 03 C384F 0A 75 C3850 89 05 ; if so, bank generates one extra gold and that's it C3851 44 FF C3852 14 44 C3853 8B 10 C3854 46 EB C3855 06 A8 ; otherwise need to check river/road/ocean remainder C3856 BA 33 C3857 72 C0 C3858 00 51 C3859 F7 EB C385A EA 82 ; if it's below 50, nothing needs doing C385B C4 83 C385C 1E F8 C385D BC 32 C385E 9C 7C C385F 03 9E ; but if not, check market, C3860 D8 49 C3861 26 74 C3862 80 05 ; and add one gold to either the bank C3863 7F FF C3864 0E 44 C3865 04 10 ; $C3866 is also $EB in v1.51, so this will get a warning ; but that also means this change can be removed from here for v1.51 C3866 75 EB C3867 05 96 ; or the market, whichever is present C3868 8B FF C3869 04 44 C386A 01 0E C386B 44 EB C386C 14 91 Drake178 (talk) 21:33, January 3, 2019 (UTC) :* Next one: Fixes the rounding errors on the city screen's production breakdown Breakdown sum should now always match the actual production. I've tried to go through the percentile modifiers in a reasonable order. However, I think it is theoretically still possible to remove a percentage such that the loss is not equal to its contribution. In this case, the remainder will be added somewhere else though, so the breakdown sum will stay correct regardless. v1.31 - v1.51 (WIZARDS.EXE) ; before checking for the foresters' guild, jump forward ; and repurpose the long division meant to set up the ; unused return value to get a terrain remainder instead C3B40 89 E9 C3B41 44 49 C3B42 0E 01 ; check for sawmill before foresters' guild C3B53 3E 2E C3B56 14 07 C3B57 8B 26 C3B58 C7 80 C3B59 BA 7F C3B5A 72 2E ; get out if not present C3B5C F7 75 C3B5D EA 3D ; save the city record pointer on the stack, C3B5E C4 53 ; and replace it with 4 C3B5F 1E BB C3B60 BC 04 C3B61 9C 00 ; get the base production, C3B62 03 8B C3B63 D8 46 C3B64 26 F6 ; word extend it, C3B65 80 99 ; then divide it by 4 C3B66 7F F7 C3B67 3E FB ; the quotient is the sawmill contribution C3B68 00 89 C3B69 75 44 C3B6A 23 06 ; swap in the remainder, C3B6B 33 92 ; multiply by 25, C3B6C C0 B3 C3B6D BA 19 C3B6E 64 F7 C3B6F 00 EB ; and add it to the stored remainder C3B70 50 01 C3B71 52 C1 ; restore the city record pointer, C3B72 8B 5B ; then check whether the remainder is below 100 C3B73 46 83 C3B74 F6 F9 C3B75 99 64 ; if so, get out of here C3B76 50 7C C3B77 52 23 ; but if not, add one hammer to the sawmill, C3B78 33 FF C3B79 D2 44 C3B7A B8 06 ; and reduce the remainder accordingly C3B7B 19 83 C3B7C 00 E9 C3B7D 59 64 C3B7E 5B EB C3B7F 9A 1B ; the next check is the foresters' guild C3B9E 2E 3E C3BA1 14 07 C3BA2 8B 26 C3BA3 C7 80 C3BA4 BA 7F C3BA5 72 3E ; get out if not present C3BA7 F7 75 C3BA8 EA 38 ; save the city record pointer on the stack, C3BA9 C4 53 ; and replace it with 4 C3BAA 1E BB C3BAB BC 04 C3BAC 9C 00 ; get the base production, C3BAD 03 8B C3BAE D8 46 C3BAF 26 F6 ; word extend it, C3BB0 80 99 ; then divide it by 4 C3BB1 7F F7 C3BB2 2E FB ; the quotient is the foresters' guild contribution C3BB3 00 89 C3BB4 75 44 C3BB5 23 08 ; swap in the remainder, C3BB6 33 92 ; multiply by 25, C3BB7 C0 B3 C3BB8 BA 19 C3BB9 64 F7 C3BBA 00 EB ; and add it to the stored remainder C3BBB 50 01 C3BBC 52 C1 ; restore the city record pointer, C3BBD 8B 5B ; then check whether the remainder is below 100 C3BBE 46 83 C3BBF F6 F9 C3BC0 99 64 ; if so, get out of here C3BC1 50 7C C3BC2 52 1E ; but if not, add one hammer to the foresters', C3BC3 33 FF C3BC4 D2 44 C3BC5 B8 08 ; and reduce the remainder accordingly C3BC6 19 83 C3BC7 00 E9 C3BC8 59 64 C3BC9 5B EB C3BCA 9A 16 ; the miners' and mechanicians' guild will get checked ; together, so zero a register to hold their status, ; and load the base production into another C3BE0 C4 90 C3BE1 1E 8B C3BE2 BC 56 C3BE3 9C F6 C3BE4 03 33 C3BE5 D8 C0 C3BEC 14 07 C3BED 8B 26 C3BEE C7 80 C3BEF BA 7F C3BF0 72 41 C3BF2 F7 75 C3BF3 EA 01 ; record the state of the miners' guild C3BF4 C4 40 C3BF5 1E 26 C3BF6 BC 80 C3BF7 9C 7F C3BF8 03 40 C3BF9 D8 01 C3BFA 26 74 C3BFB 80 07 C3BFC 7F 26 C3BFD 41 80 C3BFE 00 7F C3BFF 75 40 C3C00 23 00 C3C01 33 75 C3C02 C0 02 ; record the state of the mechanicians' guild C3C03 BA 04 C3C04 64 02 ; now check the states C3C05 00 3C C3C06 50 00 ; if neither is built, get out of here C3C07 52 74 C3C08 8B 73 C3C09 46 3C C3C0A F6 03 C3C0B 99 75 C3C0C 50 23 C3C0D 52 EB C3C0E 33 12 ; both are built, halve the base production C3C21 89 D1 C3C22 44 FA ; check if there was a remainder, C3C23 0A 73 C3C24 8B 03 ; and if so, increase mechanician's contribution by 1 C3C25 C7 FF C3C26 BA 44 C3C27 72 0C C3C28 00 01 C3C29 F7 54 C3C2A EA 0C C3C2B C4 89 C3C2C 1E 54 C3C2D BC 0A C3C2E 9C EB C3C2F 03 4C ; only one building, so check which one it is C3C30 D8 48 C3C31 26 74 C3C32 80 11 ; it's the mechanicians' guild C3C33 7F D1 C3C34 40 FA C3C35 01 89 C3C36 74 54 C3C37 14 0C ; if there's no remainder, get out of here C3C38 8B 73 C3C39 C7 42 ; otherwise compare with the existing, C3C3A BA 83 C3C3B 72 E9 C3C3C 00 32 ; get out if less than 100 total, C3C3D F7 72 C3C3E EA 3D ; or increase the contribution by one if not, C3C3F C4 FF C3C40 1E 44 C3C41 BC 0C C3C42 9C EB C3C43 03 38 ; if only the miners' guild is built, C3C44 D8 D1 C3C45 26 FA C3C46 80 89 C3C47 7F 54 C3C48 40 0A ; check for remainder, C3C49 00 73 C3C4A 75 31 ; and compare it with the existing C3C4B 23 83 C3C4C 33 E9 C3C4D C0 32 ; get out if less than 100 total, C3C4E BA 72 C3C4F 64 2C ; or increase the contribution by one C3C50 00 FF C3C51 50 44 C3C52 52 0A C3C53 8B EB C3C54 46 27 ; skip the repurposed block if no inspirations C3C82 0C 3B ; use less bytes to set the inspirations value C3C83 83 8B C3C85 FC F6 C3C86 64 89 C3C87 8B 44 C3C88 04 10 ; and skip to Cursed Lands when done C3C89 03 90 C3C8A 44 EB C3C8B 02 32 ; use the space gained to set Gaia's Blessing C3C8E 10 0E ; then using the full terrain bonus C3C9D FC EC ; get a remainder, C3CAA 34 43 ; and store it into cx, C3CAF 46 C1 ; before jumping back up C3CB0 F6 E9 C3CB1 8B 90 C3CB2 C7 FE Drake178 (talk) 19:17, January 4, 2019 (UTC) :* Next one: Fixes the rounding errors on the city screen's power income breakdown These mostly result from Divine/Infernal Power and Good/Bad Moon. Breakdown sum should now always match the actual power generated. Removing Dark Rituals, or in its absence the highest tier building, will also yield a loss equal to the listed contribution. This fix does not abuse the fact that the buildings replace each other, and should work even if that is not the case (ie. if there's no Shrine, only a Temple). v1.31 - v1.51 (WIZARDS.EXE) ; bring forward the check for the replaced shrine C3EBD 14 07 C3EBE 8B 26 C3EBF C7 80 C3EC0 BA 7F C3EC1 72 35 C3EC3 F7 75 C3EC4 EA 14 ; use the space gained to convert the shrine power ; to 1/2s and actually apply retorts if present C3EC5 C4 B8 C3EC6 1E 02 C3EC7 BC 00 C3EC8 9C 83 C3EC9 03 7E C3ECA D8 F8 C3ECB 26 64 C3ECC 80 74 C3ECD 7F 01 C3ECE 35 40 C3ECF 00 89 C3ED0 75 44 C3ED1 08 04 C3ED2 C7 89 C3ED3 44 46 C3ED4 04 F6 C3ED5 01 90 C3ED6 00 90 C3ED7 FF 90 C3ED8 46 90 C3ED9 F6 53 ; convert temple power to 1/2s, and apply ; retorts to dark rituals directly C3F02 8B B8 C3F03 46 04 C3F04 F8 00 C3F05 D1 83 C3F06 E0 7E C3F07 BB F8 C3F09 00 74 C3F0A 99 02 C3F0B F7 40 C3F0C FB 40 C3F10 83 01 C3F13 02 90 ; convert parthenon power to 1/2s, and apply ; retorts to dark rituals directly C3F40 03 06 C3F4D 83 01 C3F50 03 90 ; convert cathedral power to 1/2s, and apply ; retorts to dark rituals directly C3F78 14 13 C3F7D 02 03 C3F89 83 01 ; set dark rituals if present C3F8C 04 5B C3F90 F7 26 C3F91 6E 80 C3F92 F8 7F C3F93 BB 45 C3F94 64 00 C3F95 00 74 C3F96 99 03 C3F97 F7 89 C3F98 FB 44 C3F99 89 1A ; convert back the 1/2 powers, adding remainders ; where applicable C3F9A 46 33 C3F9B F6 C0 ; base + index C3F9C 8B BB C3F9D C7 04 C3F9E BA 00 ; loop starts here, halve the 1/2 power amount, C3F9F 72 D1 C3FA0 00 38 ; and store the remainder C3FA1 F7 14 C3FA2 EA 00 ; if there's enough to round out another point, C3FA3 C4 A8 C3FA4 1E 02 C3FA5 BC 74 C3FA6 9C 04 ; then transfer that point C3FA7 03 2C C3FA8 D8 02 C3FA9 26 FF C3FAA 80 00 ; finish after setting dark rituals C3FAB 7F 83 C3FAC 45 FB C3FAD 00 1A ; if not at cathedral yet, C3FB0 8B 83 C3FB1 46 FB C3FB2 F6 0A C3FB3 89 74 C3FB4 44 04 ; proceed to the next building C3FB5 1A 43 C3FB6 BA 43 C3FB7 02 EB C3FB8 00 E6 ; otherwise to dark rituals C3FB9 8B B3 C3FBA 46 1A C3FBB F6 EB C3FBC F7 E2 ; 4 nop's that can be scratched C3FBD EA 90 C3FBE 89 90 C3FBF 46 90 C3FC0 F6 90 ; use the correct roundings for power halving events C3FF9 8B 31 C3FFA 44 C9 C3FFB 04 31 C3FFC 40 D2 ; base + index C3FFD 99 BB C3FFE 2B 04 C3FFF C2 00 ; loop starts here, add power to original total C4000 D1 03 C4001 F8 08 ; halve the original total, C4003 44 C8 C4004 04 D1 C4005 8B F8 ; round up, C4006 44 14 C4007 06 00 ; subtract the saved halved total, C4008 40 29 C4009 99 D0 ; and the result is the generated power, C400A 2B 89 C400B C2 00 ; which is then added to the saved halved total C400C D1 01 C400D F8 C2 ; finish after setting dark rituals C400E 89 83 C400F 44 FB C4010 06 1A C4011 8B 74 C4012 44 22 ; if not at cathedral yet, C4013 08 83 C4014 40 FB C4015 99 0A C4016 2B 74 C4017 C2 04 ; proceed to the next building C4018 D1 43 C4019 F8 43 C401A 89 EB C401B 44 E4 ; otherwise to dark rituals C401C 08 B3 C401D 8B 1A C401E 44 EB C401F 0A E0 Drake178 (talk) 01:44, January 6, 2019 (UTC) :* Next one: Fixes the displayed contribution of the Foresters' Guild and Famine on the food income breakdown of the city screen produces one warning in v1.50+, overwriting the first byte of W493 Foresters' Guild was being checked not only without considering the Animists' Guild, but also ignoring its own base income during the comparison. Famine was just plain wrong, using a single formula that only applies in one out of the three possible scenarios of farming power vs tile food vs "famined" farming power (fp/2), and even then it was rounded incorrectly. Disregarding the false display of Gaia's Blessing in v1.31/v1.40 (see next patch), the breakdown sum will now always match the actual food income. Removing a source will also result in the predicted amount of income lost (or regained, in the case of Famine). v1.31 - v1.51 (WIZARDS.EXE) ; jump to the Foresters' Guild check before calculating Animists' C3190 8B E9 C3191 C6 BA C3192 BA 00 ; second half of the Famine calculations C3193 72 90 C3194 00 D1 C3195 F7 F8 C3196 EA 39 C3197 C4 C8 C3198 1E 7E C3199 BC 06 C319A 9C 29 C319B 03 C8 C319C D8 D1 C319D 26 F8 C319E 80 01 C319F 7F C8 C31A0 54 5A C31A1 00 39 C31A2 74 CA C31A3 0E 7E C31A4 8B 06 C31A5 46 29 C31A6 FA CA C31A8 E0 FA C31A9 BB 01 C31AA 03 CA C31AB 00 29 C31AC 99 C2 C31AD F7 90 C31AE FB 90 C31B0 46 55 C31B1 FA 0E ; after the Animists', jump to Gaia's instead of Foresters' C3240 8B EB C3241 C6 3E ; preserve the accumulator through the Foresters' check C3254 8B EB C3255 C6 0B ; jump shorter if no Foresters' Guild C3267 18 14 ; use the accumulator instead of a local variable, as ; neither Forester's nor Famine affects later calculations C3268 8B 83 C3269 46 C0 C326A FE 02 C327C 83 E9 C327D 46 C3 C327E FE 00 ; (scratchable nop) C327F 02 90 ; after Gaia's, check Granary instead of Famine, ; from where the function will conclude naturally C3335 8B EB C3336 C6 1D ; jump shorter if no Famine C3348 0B 07 ; first half of the Famine calculations C334A 46 4E C334B FE FA C334C 99 50 C334D 2B E9 C334E C2 43 C334F D1 FE ; jump to the Animists' Guild if no Famine C3350 F8 E9 C3351 89 5F C3352 45 FE ; (scratchable nop) C3353 0E 90 :* Next one (maybe optional, but preferably not): Corrects the food income display of Gaia's Blessing In theory, Gaia's Blessing can be said to not produce food directly, but instead allow the farmers to harvest more. In this regard, it is exactly the same as the Animists' Guild. If that was not the case, then removing it would never yield a loss of food income. This patch fixes the contribution display of Gaia's Blessing to actually show the player the amount of food they will lose if the spell is removed, if any. As such, it naturally overrides W493, which removes the spell from the display. However, this fix requires either the above patch, or W493FIX.TXT to also be installed, both of which it is designed to supplement without any warnings. v1.31 - v1.51 (WIZARDS.EXE) ; modify the function that returns the food on the ; catchment tiles to also return the amount without ; Gaia's Blessing, instead of an unused remainder BFF7C 7E 89 BFF7D 0E FE BFF7E 8B 7E BFF7F C7 0C BFF80 BA B8 BFF84 EA EF BFF8E BB C1 BFF8F 04 F8 BFF90 00 02 BFF91 99 89 BFF92 F7 F2 BFF93 FB C1 BFF94 EB FA BFF95 00 02 ; save the city pointer before calling the tile ; food function, this also negates the second ; change of W493 (its bytes are jumped over) C3280 8B 26 C3281 C6 80 C3282 BA 7F C3283 72 54 C3284 00 00 C3285 F7 74 C3286 EA 0D C3287 C4 53 C3288 1E 06 C3289 BC EB C328A 9C 0C ; store the non-gaia food limit C329E 46 D1 ; restore the city pointer C329F FA 07 C32A0 8B 5B ; get the amount of food per farmer C32A1 C6 90 C32A3 72 02 C32A5 F7 26 C32A6 EA 80 C32A7 C4 7F C32A8 1E 29 C32A9 BC 01 C32AA 9C 74 C32AB 03 0F C32AC D8 90 C32B3 28 07 C32B4 8B 26 C32B5 C6 80 C32B6 BA 7F C32B7 72 29 C32B9 F7 75 C32BA EA 01 C32BB C4 42 ; get the farmer count, C32BC 1E 26 C32BD BC 8A C32BE 9C 47 C32BF 03 15 C32C0 D8 98 ; then the total farming power C32C1 26 F7 C32C2 80 EA ; check if there's a Foresters' Guild C32C3 7F 26 C32C4 29 80 C32C5 01 7F C32C6 74 3E C32C7 14 00 C32C8 8B 74 C32C9 C6 07 C32CA BA 26 C32CB 72 80 C32CC 00 7F C32CD F7 3E C32CE EA 01 C32CF C4 75 C32D0 1E 19 ; if there is, see if it gets extra food ; because of Gaia's Blessing C32D1 BC BA C32D2 9C 01 C32D3 03 00 C32D4 D8 50 C32D5 26 40 C32D6 80 40 C32D7 7F 39 C32D8 29 C8 C32D9 00 7F C32DA 75 01 C32DB 1C 42 C32DD C6 45 C32DE BA 08 C32DF 72 29 C32E0 00 D0 C32E1 F7 7E C32E2 EA 06 ; if it does, move it over to Gaia's contribution C32E3 C4 29 C32E4 1E 45 C32E5 BC 08 C32E6 9C 01 C32E7 03 45 C32E8 D8 0C C32E9 26 58 ; calculate the farmed food without Gaia's Blessing, C32EA 8A 39 C32EB 47 C8 C32EC 15 7E C32ED 98 07 C32EE BA 29 C32EF 03 C8 C32F0 00 D1 C32F1 F7 F8 C32F2 EA 90 C32F4 46 C8 ; and compare it to the food farmed with it C32F5 FE 8B C32F6 EB 15 C32F7 17 03 C32F8 8B 55 C32F9 C6 02 C32FA BA 29 C32FB 72 C2 C32FC 00 7E C32FD F7 25 ; if it's less, check whether there's an Animists' ; Guild contribution C32FE EA 01 C32FF C4 55 C3300 1E 0C C3301 BC 83 C3302 9C 7D C3303 03 02 C3304 D8 00 C3305 26 74 C3306 8A 1A ; and if so, calculate how much of that comes ; from Gaia's Blessing, C3307 47 26 C3308 15 8A C3309 98 47 C330A D1 15 C330B E0 98 C330C 89 D1 C330D 46 E0 C330E FE 39 C330F 8B C8 C3310 46 7E C3311 FE 06 C3312 3B 29 C3313 46 C8 C3314 FA D1 C3315 7E F8 C3316 13 01 C3317 8B C8 C3318 46 2B C3319 FE 05 C331A 2B 01 C331B 46 D0 ; and change the contributions accordingly C331C FA 29 C331D 99 45 C331E 2B 02 C331F C2 29 C3320 D1 C2 ; or else it all comes out of the farmers' C3321 F8 29 C3322 8B 15 C3323 56 EB C3324 FA 10 Drake178 (talk) 23:33, January 8, 2019 (UTC) :* Next one: Restores the gold upkeep override removed by a previous patch ... really? =/ v1.51 RC only (WIZARDS.EXE) 988AB 90 EB 988AC 90 0A 988AD 90 26 988AE 90 8A 988AF 90 47 988B0 90 04 988B1 90 26 988B2 90 02 988B3 90 47 988B4 90 24 988B5 90 98 988B6 90 C3 989D6 A2 D5 989D7 00 FE 98A7A 26 FB 98A7B 8A FE 98A7C 47 C0 98A7D 04 50 98A7E 26 8B 98A7F 02 C6 98A80 47 BA 98A82 98 00 98A83 C3 F7 98A91 90 7C 98A92 90 A8 Drake178 (talk) 06:50, January 12, 2019 (UTC) :* Next one: Fixes bug: AI can't properly allocate power to skill when all of their spells have been researched Because half of their calculated research percentage is overwriting their skill percentage instead of being added to it, as it was likely intended. Granted, this only really matters if, for some reason, they are not already casting the Spell of Mastery (which overrides to 90% mana and 10% skill, usually making the loss less significant than it otherwise would be). v1.31 - v1.51 (WIZARDS.EXE) CB42B 88 00 Drake178 (talk) 01:44, January 13, 2019 (UTC) :* Next one: Fixes bug: Lion Heart items do not grant Hits overland Fixes bug: Charm of Life +Hits are not displayed as bonus (gold) Fixes bug: Bonus hits are not displayed with gold icons overland v1.31 - v1.51 (WIZARDS.EXE) ; start storing bonus hits at their first appearance ; (Black Channels) 8E6E8 25 31 8E6E9 00 F6 8E6EA 00 09 8E6EB 0B D2 8E6EC D0 74 8E6ED 74 02 8E6EE 01 46 ; continue at Lionheart 8E70E 03 08 8E712 8B 83 8E713 46 C6 8E714 06 03 8E715 B1 90 8E716 05 90 ; optimize the hero slot check, get the unit ; type along with it, and set up some variables 8E717 D3 31 8E718 E0 C0 8E719 C4 26 8E71A 1E 8B 8E71B C2 4F 8E71C 9E 05 8E71D 03 86 8E71E D8 C5 8E71F 26 98 8E720 80 89 8E721 7F C2 8E722 06 3C ; condense the constitution and super constitution ; check, and use the space to implement a Lion Heart ; item power check ; (save the variables for the ability checks here) 8E730 8B 26 8E731 46 8A 8E732 06 47 8E733 B1 03 8E734 05 98 8E735 D3 50 8E736 E0 51 ; skip the power if the enchant is already applied 8E737 C4 83 8E738 1E FE 8E739 C2 01 8E73A 9E 7F 8E73B 03 3D ; get a pointer to the hero's items, and another ; for the item table 8E73C D8 69 8E73D 26 C0 8E73E 8A C8 8E73F 47 04 8E740 03 6B 8E741 98 D2 8E742 B1 1C 8E743 02 01 8E744 D3 C2 8E745 E0 81 8E746 8B C2 8E747 D8 50 8E748 C4 9F 8E749 9F 56 8E74A 32 57 8E74B 92 C4 8E74C 8B 1E 8E74D 46 36 8E74E 06 91 ; loop through the items, summing the bitflags ; that contain the Lion Heart item power 8E74F B1 31 8E750 05 C0 8E751 D3 31 8E752 E0 FF 8E753 06 57 8E754 C4 01 8E755 36 D7 8E756 C2 8B 8E757 9E 35 8E758 03 83 8E759 F0 FE 8E75A 26 FF 8E75B 8A 7E 8E75C 44 07 8E75D 05 6B 8E75E B4 F6 8E75F 00 32 8E760 BA 26 8E761 0C 0B 8E762 00 40 8E763 F7 30 8E764 EA 5F 8E765 03 47 8E766 D8 47 8E767 07 83 8E768 26 FF 8E769 8B 06 8E76A 47 7C 8E76B 04 E7 8E76C 26 5F 8E76D 8B 5E ; check for Lion Heart 8E76E 57 A9 8E76F 02 00 8E770 81 04 8E771 E2 74 8E772 00 06 ; and apply it if present 8E773 10 83 8E774 25 C6 8E775 00 03 8E776 00 83 8E777 0B C7 8E778 D0 03 ; restore the saved variables and check ; for the constitution ability 8E779 74 58 8E77A 06 5B 8E77B 8B C1 8E77C 46 E3 8E77D FC 02 8E77E 40 C4 8E77F 03 9F 8E780 F8 32 8E781 8B 92 8E782 46 6B 8E783 06 C0 8E784 B1 0C 8E785 05 01 8E786 D3 C3 8E787 E0 26 8E788 C4 8B 8E789 1E 47 8E78A C2 02 8E78B 9E A9 8E78C 03 00 8E78D D8 10 8E78E 26 74 8E78F 8A 37 ; apply it if present, 8E790 47 03 8E791 03 7E 8E792 98 FC 8E793 B1 47 ; then jump to super constitution, 8E794 02 EB 8E795 D3 31 ; the checking of which resumes original flow 8E7C7 00 A9 8E7C8 0B 00 8E7C9 D0 20 ; in the Charm of Life block, add bonus hits 8E839 7E F8 8E83A FE 01 8E83B 01 7D 8E83C 7D 03 8E83D 05 FF 8E83E C7 46 8E83F 46 FE 8E840 FE 03 8E841 01 76 8E842 00 FE ; finally, return the bonus hits with the total 8E848 EB 89 8E849 00 F2 ; don't mark Black Channels as bonus hits in ; combat (already done above), 8E930 C4 EB 8E931 5E 0E ; but do add combat-cast Lionheart (was not ; available in the overland function) 8E957 8A F7 8E959 68 3C 8E95A 04 00 8E95B 03 04 8E95C C4 74 8E95D 5E 05 8E95E 06 26 8E95F 26 80 8E960 88 47 8E961 47 68 8E962 68 03 ; in the battle unit setup, skip the ; redundant flight movement check entirely, and ; instead use the above return to show bonus hits ; (this can be moved around if necessary) 8F2B6 8B EB 8F2B7 C6 45 8F2F3 74 26 8F2F4 08 88 8F2F5 C4 47 8F2F6 5E 10 8F2F7 06 26 8F2F8 26 88 8F2F9 C6 57 8F2FA 47 68 8F2FB 07 EB 8F2FC 06 0D 8F306 26 EB 8F307 88 EB 8F308 47 90 8F309 10 90 Drake178 (talk) 18:29, January 18, 2019 (UTC) :* Optional: (I guess?) Reverses the rule changes of W398: - Non-Corporeal units are no longer automatically Flying overland - Flying again overrides Non-Corporeal as the stack's movement type The second was obviously required by the first, as otherwise there would have been no Non-Corporeal movement type at all; but that changes the default movement type of both Wraiths and Shadow Demons, in addition to allowing things like Magic Spirits enchanted with Flight moving 6 tiles per turn. None of the actual bugfixes require either of these changes. v1.50+ only (WIZARDS.EXE) 51721 C6 90 51722 46 90 51723 DF 90 51724 01 90 5176E C6 90 5176F 46 90 51770 DF 90 51771 01 90 51AD7 03 29 Drake178 (talk) 21:26, February 6, 2019 (UTC) :* Next one: Fixes bug: Nodes can be Melded with without clearing them v1.31 - v1.51 (WIZARDS.EXE) ; condense the parameter passing for the TILE_HasNode() call, ; move up the local variable setup, and perform some extra ; for the encounter zone check loop 47E97 8B 26 47E98 04 8B 47E99 B1 17 47E9A 05 52 47E9B D3 50 47E9C E0 88 47E9D C4 F0 47E9E 1E 98 47E9F C2 50 47EA0 9E 88 47EA1 03 D0 47EA2 D8 98 47EA3 26 50 47EA4 8A 26 47EA5 47 8A 47EA6 01 47 47EA7 98 03 47EA8 50 98 47EA9 8B 89 47EAA 04 46 47EAB B1 FA 47EAC 05 33 47EAD D3 FF 47EAE E0 89 47EAF C4 7E 47EB0 1E F8 47EB1 C2 89 47EB2 9E 7E 47EB3 03 F4 47EB4 D8 90 47EB9 50 90 ; if there's no node on the tile, return 0 47EC5 8B 83 47EC6 04 F8 47EC7 B1 FF 47EC8 05 75 47EC9 D3 03 47ECA E0 E9 47ECB C4 BE 47ECC 1E 00 ; finish setting up the encounter zone check loop 47ECD C2 5A 47ECE 9E 59 47ECF 03 56 47ED0 D8 C4 47ED1 26 1E 47ED2 8A C0 47ED3 47 9C 47ED4 03 EB 47ED5 98 1F ; get the encounter zone data 47ED7 46 FE 47ED8 FA 6B 47ED9 C7 F6 47EDA 46 18 47EDB F8 01 47EDC 00 DE 47EDD 00 26 47EDE C7 8B 47EDF 46 04 47EE0 F4 39 47EE1 00 D0 ; not the same coordinates? next! 47EE2 00 75 47EE3 83 10 47EE4 7E 26 47EE5 F6 8B 47EE6 FF 44 47EE7 75 02 47EE8 03 38 47EE9 E9 C8 ; not the same plane? next! 47EEA DD 75 47EEB 00 08 47EEC 33 80 47EED FF FC 47EEE EB 01 ; already cleared, break and proceed as normal 47EEF 63 75 47EF0 8B 09 ; still intact, break and return 0 47EF1 DF 5E 47EF2 D1 EB 47EF3 E3 D6 ; loop tail (increment, comparison) 47EF4 8B 47 47EF5 00 83 47EF6 89 FF 47EF7 46 66 47EF8 FE 7C 47EF9 8B DC 47EFA 46 5E ; went into the unit check loop now, so optimize it ; to regain the space and return to the normal flow 47EFB FE 33 47EFC B1 FF 47EFD 05 EB 47EFE D3 54 47EFF E0 8B 47F00 C4 DF 47F01 1E D1 47F02 C2 E3 47F03 9E 8B 47F04 03 00 47F05 D8 C1 47F06 26 E0 47F07 8A 05 47F08 47 C4 47F09 05 1E 47F0A B4 C2 47F0B 00 9E 47F0C 89 03 47F0D 46 D8 47F0E FC 26 47F0F 8B 8A 47F10 46 47 47F11 FC 05 47F12 BA B4 47F13 24 00 47F14 00 8B 47F15 F7 D8 47F16 EA 6B 47F17 8B DB 47F18 D8 24 ; already have the unit type, don't get it again 47F21 8B EB 47F22 46 11 47F23 FE 90 ; loop tail adjustment for the new loop body address 47F57 98 A7 Drake178 (talk) 20:34, February 10, 2019 (UTC)